package com.xln.demo5抽象;

/**
 * 抽象与模板方法示例入口：用父类引用调用不同子类的作文实现。
 */
public class MainTest {
    /**
     * 主方法：构造不同年级学生并调用 write 演示多态。
     */
    public static void main(String[] args) {
        //多态
        Student student = new StudentChild("1234","胡无","男生");
        Student student1 = new StudentMid("954","胡文怡","女生");
        student.write(1);
        student1.write(8);

    }
}
